const http = await import('http');
const fs  = await import('fs');

//创建web服务实例
let app = http.createServer(function (req, res) {
    console.log(req.method);
    console.log(req.url);

    fs.readFile('index.html', 'utf8', (err, data) => {
        if (err) {

            res.end(err)
        } else {
            res.end(data)
        }
    })
})

app.listen(8000)